﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace RequirementAndBug.DAL.Models
{
    public class REQRequirement
    {
        [Key]
        [Display(Name = "主键")]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int RequireID
        {
            get;
            set;
        }

        [Display(Name = "创建者ID")]
        [Required(ErrorMessage = "不能为空")]        
        public int UserID
        {
            set;
            get;
        }
        /// <summary>
        /// 项目类型：0需求，1Bug
        /// </summary>
        [Display(Name = "项目类型")]
        [Required(ErrorMessage = "不能为空")]  
        public int ProCategory
        {
            get;
            set;
        }

        /// <summary>
        /// 需求标题
        /// </summary>   
        [Display(Name = "需求标题")]
        [StringLength(300, ErrorMessage = "长度不可超过300")]
        public string Title
        {
            get;
            set;
        }

        /// <summary>
        /// 需求描述
        /// </summary>  
        [Display(Name = "需求描述")]
        [StringLength(3000, ErrorMessage = "长度不可超过3000")]
        public string ProjectDesc
        {
            get;
            set;
        }
        /// <summary>
        /// 记录类型：0正文，1回复
        /// </summary>
        [Display(Name = "记录类型")]
        public int ProjectType
        {
            get;
            set;
        }

        [Display(Name = "创建时间")]
        public DateTime CreateTime
        {
            get;
            set;
        }

        /// <summary>
        /// 父ID，一般用于回复正文
        /// </summary>
        [Display(Name = "父ID")]
        public int? ParentID
        {
            get;
            set;
        }

        /// <summary>
        /// 项目状态：0禁用，1正常
        /// </summary>
        [Display(Name = "状态")]
        public int Status
        {
            get;
            set;
        }

        /// <summary>
        /// 项目状态：0待开发，1待测试，2带验收，3已完成
        /// </summary>
        [Display(Name = "阶段状态")]
        public int StageStatus
        {
            get;
            set;
        }

        /// <summary>
        /// 当前分派处理的用户，0表示所有人可见
        /// </summary>
        [Display(Name = "受理用户")]
        public int TargetUserID
        {
            get;
            set;
        }

        /// <summary>
        /// 是否置顶
        /// </summary>
        [Display(Name = "是否置顶")]
        public int? IsTop
        {
            get;
            set;
        }

        [Display(Name = "更新时间")]
        public DateTime? UpdateTime
        {
            get;
            set;
        }

        [Display(Name = "完成时间")]
        public DateTime? FinishTime
        {
            get;
            set;
        }
        /// <summary>
        /// 优先级，一般用于区分颜色(0优先，1重要，2待处理，3来日方长)
        /// </summary>
        [Display(Name = "优先级")]
        public int? RankSign
        {
            get;
            set;
        }
        /// <summary>
        /// 预估的工期长度（单位：天）
        /// </summary>
        [Display(Name = "预估工期")]
        public decimal? EstimateLength
        {
            set;
            get;
        }
        /// <summary>
        /// 截止日期
        /// </summary>
        [Display(Name = "截止日期")]
        [DataType(DataType.DateTime)]
        public DateTime? DeadlineTime
        {
            get;
            set;
        }
        /// <summary>
        /// 产生问题的客户端类型：0苹果，1安卓，2全部
        /// </summary>
        [Display(Name = "客户端类型")]
        public int? ClientType
        {
            get;
            set;
        }

        ///// <summary>
        ///// 建立用户与需求的多对多关系
        ///// </summary>
        //public List<REQUser> Users
        //{
        //    get;
        //    set;
        //}

    }
}